//  第一个载入的是如下格式，之后的直接用 appServe.factory()......
appServe
.factory('ArepoService', function($resource) {
  return $resource(baseUrl + '/arepo/:id/:property', {'id': '@id'}, {
    getHomePics: {
      method: 'get',
      params: {
        'id': '@id',
        'property': 'homepic'
      }
    },
    getHomeAds: {
      method: 'get',
      params: {
        'id': '@id',
        'property': 'homead'
      }
    },
    getSecondhand: {
      method: 'get',
      params: {
        'id': '@id',
        'property': 'secondhand'
      }
    },
    // ?num=???   num是指获取几个，比如3，就是获取前三个，-1是获取全部
    getSales: {
      method: 'get',
      params: {
        'id': '@id',
        'property': 'sale'
      }
    },
    // /:arepo_id/goods?class_id=&page=&num=
    getGoods: {
      method: 'get',
      params: {
        'id': '@id',
        'property': 'goods'
      }
    },
    // /:arepo_id/goods?class_id=&page=&num=&key=
    searchGoods: {
      method: 'get',
      params: {
        'id': '@id',
        'property': 'search'
      }
    }
  });
});
